#include "hmac.h"

std::string HMAC(std::string& message, std::string& user, std::string& pass){
	std::string signature = message + user + pass;
	signature = md5(signature);
	std::string final_msg = message+signature;
	return final_msg;
}

bool is_authentic(std::string& receive, std::string user, std::string pass){
	std::string message = receive.substr(0,receive.size()- BYTES_MD5);
	std::string signature = receive.substr(receive.size() - BYTES_MD5, BYTES_MD5);
	message = message+user+pass;
	message = md5(message);
	return (message == signature);
}

